// ===
// @Author       : 六网
// @Date         : 2022-04-30 16:02:21
// @LastEditTime : 2022-05-02 17:09:49
// @LastEditors  : 六网
// @FilePath     : /cec-vision-cpp/modules/include/camera.hpp
// @Gitee        : https://gitee.com/sixspace
// @Description  : 工业相机模块头文件
// === 

#ifndef CAMERA_H
#define CAMERA_H

#include "all.hpp"

class CameraPrivate;

class Camera {

private:
    explicit Camera(const std::string &configsFile);

    ~Camera();

    CameraPrivate *m_ptr;

public:
    static Camera *getInstance(const std::string &configsFile);

    bool open(bool soft = false);

    bool close();

    bool play();

    bool stop();

    std::tuple<bool, cv::Mat, int> read(int waitTime = 1);

    std::tuple<bool, float, float, float> getExposureTimeRange();

    bool setExposureTime(float times);

    std::tuple<bool, double> getExposureTime();

    bool setFrameSpeedMode(bool High);

    bool setAnalogGain(int num);

    bool setLutMode(int mode);

    bool setGamma(int num);

    bool setContrast(int num);

    std::tuple<bool, int> getFrameTimeStamp();

    bool setRoi(std::tuple<int, int> offset, std::tuple<int, int> resolution);

    bool softTrigger();

    bool setTriggerCount(int nums);

    bool openSoftTrigger();

    bool closeSoftTrigger();

    Camera(const Camera &) = delete;

    Camera &operator=(const Camera &) = delete;
};

#endif
